package Method;

/**
 * ClassName:MethodDemo7
 * Package:Method
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/12-0:43
 * @Version:v1.0
 */
public class MethodDemo7 {
    //带返回值方法的定义和调用格式
    public static void main(String[] args) {
        //直接调用
        getSum(10,20,30);
        //赋值调用
        int sum = getSum(10,20,30);
        System.out.println(sum);
        //输出调用
        System.out.println(getSum(10,20,30));

    }
    public static int getSum(int num1,int num2,int num3){
        int result = num1+num2+num3;
        return result;
    }
}
